//
//  啊.m
//  BaseRACDemo
//
//  Created by 庄波 on 2018/3/7.
//  Copyright © 2018年 庄波. All rights reserved.
//

#import "ZBFourModel.h"
#import "ZBCommonGroupViewModel.h"
#import "ZBFourHeadrItemViewModel.h"
#import "ZBCommonViewModel.h"
@interface ZBFourModel()
/// The current `user`.
@property (nonatomic, readwrite , strong) ZBUser *user;
@end

@implementation ZBFourModel

- (instancetype)initWithServices:(id<ZBViewModelServices>)services params:(NSDictionary *)params{
    if (self = [super initWithServices:services params:params]) {
        /// 获取user
        self.user = [[ZBUser alloc] init];
        self.user.phone = @"15982194670";
        self.user.screenName = @"庄波";
        self.user.featureSignature = @"只有不被善待的人才最容易识别善良";
    }
    return self;
}

- (void)initialize{
    [super initialize];
    self.title = @"我的";
    self.shouldMultiSections = YES;
    //配置数据
    [self configureData];
}

- (void)configureData{
    /// 第一组
    ZBCommonGroupViewModel *group0 = [ZBCommonGroupViewModel groupViewModel];
    /// 用户信息
    ZBFourHeadrItemViewModel *profileHeader = [[ZBFourHeadrItemViewModel alloc] initViewModelWithUser:self.user];
    profileHeader.rowHeight = 128.0f;
    group0.itemViewModels = @[profileHeader];
   
    /// 第一组
    ZBCommonGroupViewModel *group1 = [ZBCommonGroupViewModel groupViewModel];
    /// 钱包
    ZBCommonItemCellModel *wallet = [ZBCommonItemCellModel itemViewModelWithTitle:@"钱包" icon:@"MoreMyBankCard_25x25"];
    /// 设置组头高度
    group1.itemViewModels = @[wallet];
    
    /// 第二组
    ZBCommonGroupViewModel *group2 = [ZBCommonGroupViewModel groupViewModel];
    /// 收藏
    ZBCommonItemCellModel *collect = [ZBCommonItemCellModel itemViewModelWithTitle:@"收藏" icon:@"MoreMyFavorites_25x25"];
    /// 相册
    ZBCommonItemCellModel *album = [ZBCommonItemCellModel itemViewModelWithTitle:@"相册" icon:@"MoreMyAlbum_25x25"];
    /// 卡包
    ZBCommonItemCellModel *cardPackage = [ZBCommonItemCellModel itemViewModelWithTitle:@"卡包" icon:@"MyCardPackageIcon_25x25"];
    /// 表情
    ZBCommonItemCellModel *expression = [ZBCommonItemCellModel itemViewModelWithTitle:@"表情" icon:@"MoreExpressionShops_25x25"];
//    expression.destViewModelClass = [MHEmotionViewModel class];
    group2.itemViewModels = @[collect, album, cardPackage,expression];
    
    /// 第三组
    ZBCommonGroupViewModel *group3 = [ZBCommonGroupViewModel groupViewModel];
    /// 设置
    ZBCommonItemCellModel *setting = [ZBCommonItemCellModel itemViewModelWithTitle:@"设置" icon:@"MoreSetting_25x25"];
//    setting.destViewModelClass = [MHSettingViewModel class];
    
#if defined(DEBUG)||defined(_DEBUG)
    /// 调试模式
    ZBCommonItemCellModel *debug = [ZBCommonItemCellModel itemViewModelWithTitle:@"打开/关闭调试器" icon:@"mh_profile_debug_25x25"];
    debug.operation = ^{
//        [[MHDebugTouchView sharedInstance] setHide:![MHDebugTouchView sharedInstance].isHide];
//        [MHSharedAppDelegate.window bringSubviewToFront:[MHDebugTouchView sharedInstance]];
    };
    group3.itemViewModels = @[setting , debug];
#else
    /// 发布模式
    group3.itemViewModels = @[setting];
#endif
    self.dataSource = @[group0 , group1 , group2 , group3];

}
@end
